home *** CD-ROM | disk | FTP | other *** search
- /************************************************************
- *
- * Created: Thursday, December 3, 1992 12:01:00 PM
- * NeoPP.h
- * PowerPlant -specific definitions for NeoLogic products
- *
- * Copyright © Neologic Systems 1992-1993. All Rights Reserved.
- * All rights reserved
- *
- ***********************************************************/
- #pragma once /* Include this file only once */
-
- #ifdef qNeoDebug
- #define DEBUG_On 1
- #endif
-
- #define qPowerPlant 1
- #include "PP_Types.h"
-
- #define qNeoPtrBased 1
-
- #define CNeoAppBaseH "LDocApplication.h"
- class LDocApplication;
- #define CNeoAppBase LDocApplication
- #define CNeoAppPPH "CNeoAppPP.h"
- #define CNeoAppNativeH CNeoAppPPH
- class CNeoAppPP;
- #define CNeoAppNative CNeoAppPP
-
- class LSingleDoc;
- #define CNeoDocBase LSingleDoc
- #define CNeoDocBaseH "LSingleDoc.h"
- #define CNeoDocPPH "CNeoDocPP.h"
- #define CNeoDocNativeH CNeoDocPPH
- class CNeoDocPP;
- #define CNeoDocNative CNeoDocPP
-
- #define CNeoPersistNativeH CNeoPersistH
- class CNeoPersist;
- #define CNeoObject CNeoPersist
- #define CNeoPersistNative CNeoPersist
-
- #define CNeoDatabaseBaseH "LFile.h"
- class LFile;
- #define CNeoDatabaseBase LFile
- #define CNeoDatabasePPH "CNeoDatabasePP.h"
- #define CNeoDatabaseNativeH CNeoDatabasePPH
- class CNeoDatabasePP;
- #define CNeoDatabaseNative CNeoDatabasePP
-
- #define kNeoWaitForever -1
-
- #define CNeoIteratorNativeH CNeoIteratorH
- class CNeoIterator;
- #define CNeoIteratorNative CNeoIterator
-
- #include "LPeriodical.h"
-
- class CNeoChore : public LPeriodical
- {
- public:
- virtual void Perform(long *aMaxSleep);
- virtual void SpendTime(const EventRecord &aEvent);
- };
-
- class LList;
- typedef LList CNeoArray;
-
- class LWindow;
- typedef LWindow CNeoWindowBase;
- #define CNeoWindowBaseH "LWindow.h"
-
- #define gNeoApp CNeoAppPP::FApplication
- #define cmdRemoteOpen 1025
-
- // Macro for manipulating a CNeoArray
- #define NeoArrayAddObj(a, o) ((CNeoArray *)(a))->InsertItemsAt(1, 0x7FFFFFFF, &(o))
- #define NeoArrayCount(a) (a)->GetCount()
- #define NeoArrayCreate(a) (a) = new CNeoArray
- #define NeoArrayDispose(a) delete (a)
- #define NeoArrayGetObj(a, i, o) ((CNeoArray *)(a))->FetchItemAt((i), &(o))
-
- // Macro for manipulating a window object
- #define NeoGetWinGrafPort(w) (w)->GetMacPort()
- #define NeoGetWinTitle(w, s) (w)->GetDescriptor(s)
-
- // Macro for document object of a window object
- #define NeoWin2Doc(w) CNeoDocPP::FindByWindow(w)
-
- // Macro for adding a chore to the applications chore list
- #define NeoAddChore(c) (c)->StartIdling();
- #define NeoAddIdleChore(c) (c)->StartIdling();
- #define NeoRemoveChore(c) (c)->StopIdling();
- #define NeoMaxSleep 10
-
- enum {
- NeoAppNeedMemory = 50,
- NeoDirtyBase = 60,
- NeoAddObject = 61,
- NeoChangeObject = 62,
- NeoDeleteObject = 63
- };
-
- #include <UException.h>
-
- #define NEOTRY \
- { Boolean Neopropagate = 1; \
- UException _TryObject; \
- _TryObject.mError = 0; \
- _TryObject.mNextHandler = UException::sFirstHandler; \
- UException::sFirstHandler = &_TryObject; \
- if (setjmp(_TryObject.mSaveBuffer) == 0) {
-
- #define NEOCATCH Catch_(NeoLastError) \
- if (Neopropagate) \
- Throw(NeoLastError); \
-
- #define NEOENDTRY EndCatch_
-
- // Macros for handling failures
- #define NEOTRYTO \
- { Boolean Neopropagate = 1; \
- int __result; \
- UException _TryObject; \
- _TryObject.mError = 0; \
- _TryObject.mNextHandler = UException::sFirstHandler; \
- UException::sFirstHandler = &_TryObject; \
- __result = setjmp(_TryObject.mSaveBuffer); \
- if (!__result) {
-
- #define NEOCLEANUP \
- } \
- ExceptionCode NeoLastError = _TryObject.mError; \
- UException::sFirstHandler = _TryObject.mNextHandler;
-
- #define NEOENDTRYTO \
- if (__result && Neopropagate) \
- Throw(NeoLastError); \
- }
-
- #define TRYTO NEOTRYTO
- #define CLEANUP NEOCLEANUP
- #define ENDTRYTO NEOENDTRYTO
- #define FailOSErr(err) ThrowIfOSErr_(err)
- #define FailNIL(x) ThrowIfNil_(x)
-
- #define NeoPropagateFailure(x) Neopropagate = (x)
- #define NeoFailErr() NeoLastError
-